<?php

namespace Wx\ApiBundle\Entity;

use Doctrine\ORM\Mapping as ORM;

/**
 * UserConfig
 */
class UserConfig {

    /**
     * @var integer
     */
    private $id;

    /**
     * @var string
     */
    private $url;

    /**
     * @var string
     */
    private $token;

    /**
     * @var string
     */
    private $wxOriginId;

    /**
     * @var string
     */
    private $appid;

    /**
     * @var string
     */
    private $appsecret;

    /**
     * @var string
     */
    private $partnerid;

    /**
     * @var string
     */
    private $partnerkey;

    /**
     * @var string
     */
    private $paysignkey;

    /**
     * @var integer
     */
    private $createdAt;

    /**
     * @var integer
     */
    private $updatedAt;

    /**
     * @var \Wx\ApiBundle\Entity\User
     */
    private $user;

    /**
     * Get id
     *
     * @return integer 
     */
    public function getId() {
        return $this->id;
    }

    /**
     * Set url
     *
     * @param string $url
     * @return UserConfig
     */
    public function setUrl($url) {
        $this->url = $url;

        return $this;
    }

    /**
     * Get url
     *
     * @return string 
     */
    public function getUrl() {
        return $this->url;
    }

    /**
     * Set token
     *
     * @param string $token
     * @return UserConfig
     */
    public function setToken($token) {
        $this->token = $token;

        return $this;
    }

    /**
     * Get token
     *
     * @return string 
     */
    public function getToken() {
        return $this->token;
    }

    /**
     * Set wxOriginId
     *
     * @param string $wxOriginId
     * @return UserConfig
     */
    public function setWxOriginId($wxOriginId) {
        $this->wxOriginId = $wxOriginId;

        return $this;
    }

    /**
     * Get wxOriginId
     *
     * @return string 
     */
    public function getWxOriginId() {
        return $this->wxOriginId;
    }

    /**
     * Set appid
     *
     * @param string $appid
     * @return UserConfig
     */
    public function setAppid($appid) {
        $this->appid = $appid;

        return $this;
    }

    /**
     * Get appid
     *
     * @return string 
     */
    public function getAppid() {
        return $this->appid;
    }

    /**
     * Set appsecret
     *
     * @param string $appsecret
     * @return UserConfig
     */
    public function setAppsecret($appsecret) {
        $this->appsecret = $appsecret;

        return $this;
    }

    /**
     * Get appsecret
     *
     * @return string 
     */
    public function getAppsecret() {
        return $this->appsecret;
    }

    /**
     * Set partnerid
     *
     * @param string $partnerid
     * @return UserConfig
     */
    public function setPartnerid($partnerid) {
        $this->partnerid = $partnerid;

        return $this;
    }

    /**
     * Get partnerid
     *
     * @return string 
     */
    public function getPartnerid() {
        return $this->partnerid;
    }

    /**
     * Set partnerkey
     *
     * @param string $partnerkey
     * @return UserConfig
     */
    public function setPartnerkey($partnerkey) {
        $this->partnerkey = $partnerkey;

        return $this;
    }

    /**
     * Get partnerkey
     *
     * @return string 
     */
    public function getPartnerkey() {
        return $this->partnerkey;
    }

    /**
     * Set paysignkey
     *
     * @param string $paysignkey
     * @return UserConfig
     */
    public function setPaysignkey($paysignkey) {
        $this->paysignkey = $paysignkey;

        return $this;
    }

    /**
     * Get paysignkey
     *
     * @return string 
     */
    public function getPaysignkey() {
        return $this->paysignkey;
    }

    /**
     * Set createdAt
     *
     * @param integer $createdAt
     * @return UserConfig
     */
    public function setCreatedAt($createdAt) {
        $this->createdAt = $createdAt;

        return $this;
    }

    /**
     * Get createdAt
     *
     * @return integer 
     */
    public function getCreatedAt() {
        return $this->createdAt;
    }

    /**
     * Set updatedAt
     *
     * @param integer $updatedAt
     * @return UserConfig
     */
    public function setUpdatedAt($updatedAt) {
        $this->updatedAt = $updatedAt;

        return $this;
    }

    /**
     * Get updatedAt
     *
     * @return integer 
     */
    public function getUpdatedAt() {
        return $this->updatedAt;
    }

    /**
     * Set user
     *
     * @param \Wx\ApiBundle\Entity\User $user
     * @return UserConfig
     */
    public function setUser(\Wx\ApiBundle\Entity\User $user = null) {
        $this->user = $user;

        return $this;
    }

    /**
     * Get user
     *
     * @return \Wx\ApiBundle\Entity\User 
     */
    public function getUser() {
        return $this->user;
    }

    /**
     * @ORM\PrePersist
     */
    public function setCreatedAtValue() {
        if (!$this->getCreatedAt()) {
            $this->created_at = new \DateTime();
        }
    }

    /**
     * @ORM\PreUpdate
     */
    public function setUpdatedAtValue() {
        $this->updated_at = new \DateTime();
    }

}
